<?php
class Ban extends AppModel 
{
	var $name = 'Ban';
    var $validate = array(
        'ipaddress' => 'unique'
    );

	function isBanned()
	{
		$ips = $this->find('list', array(
			'fields' => 'ipaddress'
		));
		if(in_array($_SERVER['REMOTE_ADDR'], $ips)) {
			return true;
		}
		else {
			return false;
		}
	}
}
?>